package com.android1.amarena2d.test;

import com.android1.amarena2d.input.InverseScrollController;
import com.android1.amarena2d.nodes.LayerNode;
import com.android1.amarena2d.nodes.Scene;
import com.android1.amarena2d.nodes.SimpleLabel;
import com.android1.amarena2d.nodes.sprites.Sprite;
import com.badlogic.gdx.graphics.Color;

public class ParallaxExampleScene extends Scene {


    public ParallaxExampleScene() {

        engine.getRenderer().setClearColor(Color.WHITE);

        //touching the layer will move the camera around.
        touch().makeTouchable(new InverseScrollController(engine.getCamera())).setTranslateToScreen();

        LayerNode map = createLayer();
        LayerNode clouds = createLayer();

        final Sprite mapSprite = new Sprite("assets/map.png", 0, 20);

        mapSprite.sync().syncPositionFrom(engine.getCamera());
        mapSprite.sync().setPosSyncScale(0.5F);
        
        map.add(mapSprite);

        final Sprite cloud1 = new Sprite("assets/cloud1.png", 150, 150);
        final Sprite cloud2 = new Sprite("assets/cloud2.png", 250, 230);

        clouds.add(cloud1, cloud2);

        add(new SimpleLabel("(Drag the Screen.)", 100, 20, Color.BLACK));


    }


}